package com.mapper;

import com.pojo.ShangJia;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShangJiaMapper {

    @Insert("insert into shangjia (shang_id,name ,category_id ,image,notes ,longitude ,latitude ,create_time) values(#{shangId},#{name} ,#{categoryId} ,#{image},#{notes},#{longitude} ,#{latitude} ,#{createTime})")
    Boolean insertSJ(ShangJia shangjia);

    @Select("select shang_id shangId,name ,category_id categoryId,image,notes ,status,longitude ,latitude,create_time createTime,is_deleted isDeleted from shangjia where status=1 and is_deleted=0")
    List<ShangJia> queryAllShangJia();
}
